package com.sptpc.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class    HelloController {
//    Restful 风格的请求
//    经典的http请求 get post
//    新建 post /url (资源)/ json(描述新资源)
//        post /drink/ {"name":"奶茶","price":9.00}
//    修改 put /url (资源)/ json(描述原有资源的修改)
//        put /drink/ {"id":1,"name":"新奶茶"}
//    删除 delete /url(资源)
//            delete /url(资源)/id
//            delete /drink
//            delete /drink/1
//    查询 get /url(资源)/
//          get /url(资源)/id
//          get /drink
//          get /drink/id



//    get /hello/hi
    @RequestMapping("/hi")
    public String sayHi(@RequestParam("name") String name){
        return name+",欢迎使用Spring Boot!";
    }
}
